package com.jay.tools.recycler;

import android.view.View;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;

import java.util.List;

/**
 * author: tanjianpei
 * date: 2018/6/4 004 9:05
 * <p>
 * description:
 */
public abstract class SingleRecyclerAdapter<T> extends BaseQuickAdapter<T, MultipleViewHolder> {

    protected OnItemClick<T> mListener;
    protected int mPosition = 0;

    public void setPosition(int position) {
        mPosition = position;

        notifyDataSetChanged();
    }

    public SingleRecyclerAdapter(int layoutResId, @Nullable List<T> data) {
        super(layoutResId, data);
    }

    public void setClickListener(OnItemClick<T> itemClick) {
        mListener = itemClick;
    }

    @Override
    protected MultipleViewHolder createBaseViewHolder(View view) {
        return MultipleViewHolder.create(view);
    }

    protected abstract void convert(MultipleViewHolder holder, T info);
}
